home *** CD-ROM | disk | FTP | other *** search
-
- #include <\desmet\include\stdio.h>
- #include <filefind.h>
- #define EOS '\0'
- #define EOFILE '\032'
- #define ERROR (-1)
-
- main(argc,argv)
- int argc;
- char *argv[];
- {
- FILE fp;
- int c;
- int i=0;
- char path[85], fileBuf[85];
- char *where;
- struct DataArea DTA;
-
- setDta(&DTA);
- --argc;
- if(argc) {
- while(argc) {
- ++i;
- strcpy(path,argv[i]);
- if((where=rindex(path,'\\')))
- *(where+1)=EOS;
- else if((where=rindex(path,':')))
- *(where+1)=EOS;
- else
- path[0]=EOS;
- if(findFirst(argv[i],F_NORMAL)) {
- do {
- strcpy(fileBuf,path);
- strcat(fileBuf,DTA.dta_name);
- if((fp=fopen(fileBuf,"r")) != ERROR) {
- while((c=fgetc(fp)) != EOF)
- fputc(c,stdout);
- fclose(fp);
- } else
- fprintf(stderr,"Can't Access %s ...\n",DTA.dta_name);
- } while(findNext(F_NORMAL));
- } else
- fprintf(stderr,"Can't Find %s ...\n",argv[i]);
- --argc;
- }
- }
- else {
- while((c=fgetc(stdin)) != 0x04 && c != EOF && c != EOFILE) {
- fputc(c,stdout);
- }
- }
- }